home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr11 / pdox693.zip / TI519.ASC < prev    next >
Text File  |  1992-12-02  |  3KB  |  133 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.   PRODUCT  :  Paradox                                NUMBER  :  519
  8.   VERSION  :  All
  9.        OS  :  DOS
  10.      DATE  :  December 2, 1992                         PAGE  :  1/2
  11.  
  12.     TITLE  :  How to Remove Leading Blanks From All Records of a
  13.               Single Field
  14.  
  15.  
  16.  
  17.  
  18.   This Technical Information sheet illustrates how you can use PAL
  19.   to remove the leading blanks from a field for all records in a
  20.   table.  In the example below, we are modifying a field named
  21.   "Short" within a table named "Tabname".  The script removes the
  22.   leading blanks from all the "Short" values within the table
  23.   "Tabname".  In your script, you need to substitute your tablename
  24.   for "Tabname" and your fieldname for "Short".
  25.  
  26.   To create the script:
  27.  
  28.      1.  From the Paradox Menu, select Scripts
  29.  
  30.      2.  Editor
  31.  
  32.      3.  New (for versions earlier than 4.0, this choice would be
  33.          Write)
  34.  
  35.      4.  At the prompt type in a name for the script (i.e.
  36.          LEADBLNK)
  37.  
  38.      5.  You are now in the PAL Script Editor.
  39.  
  40.      6.  Type the script below:
  41.  
  42.          EDIT "Tabname"       ; Place table in edit mode.
  43.          SCAN                 ; Scan each element in table.
  44.             WHILE true        ; Loop until all blanks are removed.
  45.  
  46.               IF MATCH([Short]," ..",temp) = false THEN
  47.                  QUITLOOP            ; Leave while-loop, if
  48.               ENDIF                  ; no leading blanks exist.
  49.                  [Short] = temp
  50.                               ; Update field value each
  51.                               ; time a blank is removed with the
  52.                               ; temporary variable temp.
  53.             ENDWHILE
  54.          ENDSCAN
  55.          Do_It!               ; Save all changes.
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.   PRODUCT  :  Paradox                                NUMBER  :  519
  74.   VERSION  :  All
  75.        OS  :  DOS
  76.      DATE  :  December 2, 1992                         PAGE  :  2/2
  77.  
  78.     TITLE  :  How to Remove Leading Blanks From All Records of a
  79.               Single Field
  80.  
  81.  
  82.  
  83.  
  84.   To play the script:
  85.  
  86.      1.  From the Paradox Menu, select Scripts | Play
  87.  
  88.      2.  At the prompt, type the name of the script
  89.  
  90.  
  91.   For additional information about PAL, refer to the PAL Reference
  92.   Guide (for versions earlier than 4.0, refer to the PAL User's
  93.   Guide).
  94.  
  95.   DISCLAIMER: You have the right to use this technical information
  96.   subject to the terms of the No-Nonsense License Statement that
  97.   you received with the Borland product to which this information
  98.   pertains.
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.